home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / audiol1a / readme.txt < prev   
Encoding:
Text File  |  1998-04-14  |  4.1 KB  |  87 lines

  1.                      ---------------------------------------
  2.                               Microsoft Visual Basic
  3.                      Audio Level Sample Project Readme File
  4.                                     April 1998
  5.                ---------------------------------------
  6.  
  7. Audiolbl.exe is a self-extracting compressed file with a Visual Basic project that displays the input and output volume levels from a sound card. The project uses several Windows API functions.
  8.  
  9. MORE INFORMATION
  10. ================
  11.  
  12. When you run the self-extracting compressed file, the following files are expanded into the Audio Level Sample Project directory of your system:
  13.  
  14.  - Form1.frm    (6K)-the main form of the project.
  15.  - Module1.bas (53K)-the module file with the function declarations.
  16.  - Project1.vbp (1K)-the project file
  17.  - Project1.vbw (1K)-the project workspace file
  18.  - Readme.txt-you are currently reading this file.
  19.  
  20. To run the project, you will need a system with a sound card and a microphone. Open the project in Visual Basic and click Start from the Run menu. Click get input and speak into the microphone. The audio level from the microphone is displayed in a input level progress bar. Play a .WAV file and the audio level is displayed in the output level progress bar.
  21.  
  22. How The Sample Works
  23. --------------------
  24.  
  25. The sample demonstrates how to display the audio level of an input or output device. The level is stored in a member of a user-defined type variable. The sample uses several API functions to manipulate several user-defined type variables in order to extract the audio level.
  26.  
  27. When you first run the project, the mixerOpen function is used to get a handle to the mixer device. The handle is used with the mixerGetLineInfo function to get the capabilities of the mixer device. The capabilities are stored in the MIXERLINE and the MIXERLINECONTROLS user-defined variables. Some of the members of these variables are pointers that you need to manipulate in order to control the mixer. To manipulate this pointers, you need to copy the variables into a buffer using the GlobalAlloc function. After manipulating the variable members, you copy the contents of the buffer back to the variable using the RtlMemory function.
  28.  
  29. The Timer control is used to query these user-defined variables to get the audio level. This level is displayed in the appropriate progress bar.
  30.  
  31. When you click get input, a user-defined function opens the wave input device using the waveInOpen function. The waveInOpen function requires the WAVEFORMAT user-defined type to configure the recording settings such as the number of channels, the number of sampling bits, and the sampling rate. The wave input device requires a buffer to process the input data. You create this buffer with the waveInPrepareHeader function. The buffer is then sent to the wave input device with the waveInAddBuffer function.
  32.  
  33. With the buffer created, you can start input on the wave device using the waveInStart function. 
  34.  
  35. The output level is displayed in a similar fashion.
  36.  
  37. REFERENCES
  38. ==========
  39.  
  40. For more information about the functions used in this sample project, please see the following topics in the Platform SDK product documentation:
  41.  
  42. - Memory Management functions
  43.    GlobalAlloc
  44.    GlobalLock
  45.    GlobalFree
  46.    RtlMoveMemory
  47.  
  48. - Mixer device functions
  49.    mixerClose
  50.    mixerGetControlDetails
  51.    mixerGetDevCaps
  52.    mixerGetID
  53.    mixerGetLineControls
  54.    mixerGetLineInfo
  55.    mixerGetNumDevs
  56.    mixerMessage
  57.    mixerOpen
  58.    mixerSetControlDetails
  59.  
  60. - Wave Input device functions
  61.    waveInOpen
  62.    waveInPrepareHeader
  63.    waveInReset
  64.    waveInStart
  65.    waveInStop
  66.    waveInUnprepareHeader
  67.    waveInClose
  68.    waveInGetDevCaps
  69.    waveInGetNumDevs
  70.    waveInGetErrorText
  71.    waveInAddBuffer
  72.  
  73. For more information about the user-defined types used in this sample, please see the following topics in the Platform SDL product documentation:
  74.  
  75. - Mixer device user-defined types
  76.    MIXERCAPS
  77.    MIXERCONTROL
  78.    MIXERCONTROLDETAILS
  79.    MIXERCONTROLDETAILS_SIGNED
  80.    MIXERLINE
  81.    MIXERLINECONTROLS
  82.  
  83. - Wave device user-defined types
  84.    WAVEHDR
  85.    WAVEINCAPS
  86.    WAVEFORMAT
  87.